package com.joysuch.wwyt.bp.entity.inspect;

import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * 巡检-检查点
 */
@Data
@Entity
@EntityListeners({AutoSetCommonFieldListener.class })
@Table(name = "WWYT_BP_INSPECT_POINT_TYPE")
@SQLDelete(sql = "update WWYT_BP_INSPECT_POINT_TYPE set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql = "update WWYT_BP_INSPECT_POINT_TYPE set DELETE_FLAG = '1' where id= ?")
@Where(clause = "DELETE_FLAG = '0'")
public class BPInspectPointType implements Serializable {

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @ApiModelProperty("主键ID")
    private Long id;

    @ApiModelProperty("检查点类型名称")
    private String typeName;

    @ApiModelProperty("检查点类型数量")
    private Integer typeCount;

    //通用字段

    @ApiModelProperty("租户")
    private Long tenentId;

    @ApiModelProperty("组织机构代码")
    private String orgCode;

    @ApiModelProperty("删除标记")
    private String deleteFlag;
}
